package com.hluck.lifecycles

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.SystemClock
import androidx.databinding.DataBindingUtil
import com.hluck.lifecycles.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    private lateinit var mBinding:ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = DataBindingUtil.setContentView(this,R.layout.activity_main)
        //SystemClock.elapsedRealtime()是Android系统中的一个方法，用于获取从系统开机到当前时间的毫秒数。
//        mBinding.timer.base = SystemClock.elapsedRealtime()
        lifecycle.addObserver(mBinding.timer)
    }

}